with Sdl_Video_H; with Ada.Numerics.Elementary_Functions;
with Sdl_Gfxprimitives_H; use Sdl_Gfxprimitives_H;
use Ada.Numerics.Elementary_Functions;
with Interfaces.C; use Interfaces.C;

package body Moteur_Graphique is

   procedure Dessiner (C : in out Sdl_Surface; Objet : Bille_Type) is
      X : Interfaces.C.Short ;
      Y : Interfaces.C.Short ;
   begin
      X := Short (Objet.Pos.X);
      Y := Short (Objet.Pos.Y);

      if Filledcirclergba (C, X, Short (Get_Height (C)) - Y, Short (Objet.Rayon), unsigned_char(Objet.Couleur.R), unsigned_char(Objet.Couleur.G), unsigned_char(Objet.Couleur.B), 255) = 0 then
         null;
      end if;

      if Sdl_Gfxprimitives_H.aacircleRGBA (C, X, Short (Get_Height (C))-Y, Short (Objet.Rayon), 0,0, 0, 255) = 0 then
         null;
      end if;

   exception
      when others =>
         null;
   end Dessiner;


   procedure Dessiner (C : in out Sdl_Surface; Scene : Scene_Type) is
   begin
      for I in 1 .. Scene.Get_Nb_Objets loop
         Dessiner (C, Scene.Get_Objet(I));
      end loop;
   end Dessiner;

end Moteur_Graphique;
